// SnoopRequest.h
//
#ifndef __SNOOPREQUEST_H_
#define __SNOOPREQUEST_H_

#include "base/Request.h"
#include "scc/MatchInfo.h"
#include "util/List.h"

class SnoopRequest : public Request {
  public:
    NEW_DELETE_OPERATORS_H(SnoopRequest,Request);
    SnoopRequest (Entity* source, Entity* dest) :
        Request(source, dest),
        packet(NULL),
        interconnect(NULL),
        dirtyLine(false),
        dataLoaded(false),
        matches(NULL)          
        { }

    virtual ~SnoopRequest () {
    }
    
    Packet* getPacket() {
        return packet;
    }
    void setPacket(Packet* pk) {
        packet = pk;
    }

    Entity* getInterconnect () {
        return interconnect;
    }
    void setInterconnect (Entity* e) {
        interconnect = e;
    }

    bool hasDirtyLine() {
        return dirtyLine;
    }

    void setDirtyLine(bool _b) {
        dirtyLine = _b;
    }

    bool hasData() {
        return dataLoaded;
    }

    void setHasData(bool _b) {
        dataLoaded = _b;
    }
    
    List<MatchInfo*>* getMatches() {
        if (matches == NULL) {
            matches = NEW List<MatchInfo*>;
        }
        
        return matches;
    }
    
  private:
    Packet* packet;
    Entity* interconnect;
    bool dirtyLine;
    bool dataLoaded;
    List<MatchInfo*>* matches;
};

#endif // __SNOOPREQUEST_H__
